package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.SystemRoleMenu;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-01
* description:角色和菜单关联表
*/
@Data
public class SystemRoleMenuDto extends BaseField {

    @ApiModelProperty(value = "自增编号")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "角色ID")
    private Long roleId;

    @ApiModelProperty(value = "菜单ID")
    private Long menuId;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public SystemRoleMenu invertEntity(){
        SystemRoleMenu dto = new SystemRoleMenu();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setRoleId(this.getRoleId());
        dto.setMenuId(this.getMenuId());
        return dto;
    }
}
